/*
 * @Author: hui'chan lihuichan@yxhyidc.com
 * @Date: 2022-07-02 17:32:12
 * @LastEditors: 李惠婵 lihuichan@yxhyidc.com
 * @LastEditTime: 2022-08-25 14:35:54
 * @FilePath: \Wuhua_CountyGovg:\project\rural-revitalization-web\src\api\tenant\tenant.js
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
import request from '@/utils/request'
//查询租户列表
export function listTenant(query) {
    return request({
        url: '/tenant/list',
        method: 'get',
        params: query
    })
}
//新增租户
export function addTenant(data) {
    return request({
        url: '/tenant',
        method: 'post',
        data: data
    })
}
// 修改租户
export function updateTenant(data) {
    return request({
        url: '/tenant',
        method: 'put',
        data: data
    })
}
// 删除租户
export function delTenant(ids) {
    return request({
        url: '/tenant/' + ids,
        method: 'delete'
    })
}
//更新租户套餐状态
export function updateTenantComboStatus(tenantComboId, status) {
    return request({
        url: '/tenant/updateTenantComboStatus?tenantComboId=' + tenantComboId + '&status=' + status,
        method: 'put',
    })
}
//更新租户状态
export function updateStatus(tenantId, status) {
    return request({
        url: '/tenant/updateStatus?tenantId=' + tenantId + '&status=' + status,
        method: 'put',
    })
}
//获取平台主域名
export function domain() {
    return request({
        url: '/tenant/domain',
        method: 'get',
    })
}
//获取租户详细信息
export function getTenant(id) {
    return request({
        url: '/tenant/' + id,
        method: 'get',
    })
}
//获取租户字典
export function getTenantDic(tenantName) {
    return request({
        url: '/tenant/dic?tenantName=' + tenantName,
        method: 'get',
    })
}
//获取租户服务明细
export function getServiceItem(tenantId) {
    return request({
        url: '/tenant/serviceItem/' + tenantId,
        method: 'get',
    })
}
//查询租户套餐关联列表
export function getComboList(query) {
    return request({
        url: '/tenant/combolist',
        method: 'get',
        params: query
    })
}
//添加租户套餐关联
export function tenantAddCombo(data) {
    return request({
        url: '/tenant/addCombo',
        method: 'post',
        data: data
    })
}
//删除租户套餐关联
// 删除租户
export function delTenantCombo(tenantComboIds) {
    return request({
        url: '/tenant/delTenantCombo/' + tenantComboIds,
        method: 'delete'
    })
}
//重载租户数据源
export function loadingSource(tenantId) {
    return request({
        url: '/system/dataSource/loadingSource?tenantId=' + tenantId,
        method: 'post',
    })
}
//租户数据源数据初始化
export function dataInit(tenantId) {
    return request({
        url: '/tenant/dataInit?tenantId=' + tenantId,
        method: 'post',
    })
}
//重置租户密码/system/user/resetTenantPwd
export function resetTenantPwd(data) {
    return request({
        url: '/system/user/resetTenantPwd',
        method: 'post',
        data: data
    })
}
//更新租户功能/system/user/resetTenantPwd
export function updateFunc() {
    return request({
        url: '/tenant/updateFunc',
        method: 'post',
    })
}
//获取当前登录用户的租户信息
export function gettenantInfo() {
    return request({
        url: '/tenant/info',
        method: 'get',
    })
}
//当前租户修改租户信息 
export function editSelf(data) {
    return request({
        url: '/tenant/editSelf',
        method: 'post',
        data: data
    })
}
//获取当前租户服务信息
export function serviceInfo() {
    return request({
        url: '/tenant/serviceInfo',
        method: 'get',
    })
}


